package com.autohelper.app.tcp.cmd;

public enum CmdEnum {
    DEVICE_NO(0, "设备号"),
    HEART(1, "心跳"),
    START_APP(2, "启动APP"),
    SWIPE(4, "滑动"),
    INPUT(5, "输入文本"),
    INPUT_KEY(6, "输入键盘"),
    CLICK(7, "点击"),
    UI_XML(8, "获取UI"),
    WM_SIZE(9, "设备尺寸"),
    SCREEN_CAPTURE(10, "截屏"),
    GO_BACK(11, "返回键"),
    GO_HOME(12, "回到Home"),
    CLEAR_TEXT(13, "清空输入"),
    GET_CLIPBOARD_CONTENT(14, "获取粘贴板内容"),
    SET_CLIPBOARD_CONTENT(15, "设置粘贴板内容"),

    SHELL(99, "shell指令"),
    ;

    public final short code;
    private final String title;

    CmdEnum(int code, String title) {
        this.code = (short) code;
        this.title = title;
    }

    public static CmdEnum getByCode(short code) {
        for (CmdEnum e : values()) {
            if (e.code == code) {
                return e;
            }
        }
        return null;
    }
}
